<%@ page language="java" contentType="text/html; charset=EUC-KR"
	pageEncoding="EUC-KR"%>
<%request.setCharacterEncoding("euc-kr");%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%
	String num=request.getParameter("num");
	String pass=request.getParameter("pass");

	
	Class.forName("com.mysql.jdbc.Driver");

	Connection conn = null;
	PreparedStatement pstmt = null;
	Statement stmt = null;
	ResultSet rs = null;

	
		String jdbcDriver ="jdbc:mysql://localhost:3306/coffee?" +
							"useUnicode=true&characterEncoding=euckr";
		String dbUser="root";
		String dbPass="123456";
		
		conn = DriverManager.getConnection(jdbcDriver, dbUser, dbPass);
		
		String strSQL="select pass from RVboard where num=?";
		pstmt=conn.prepareStatement(strSQL);
		pstmt.setInt(1,Integer.parseInt(num));
		
		rs=pstmt.executeQuery();
		rs.next();
		
		String goodpass=rs.getString("pass").trim();
			if(pass.equals(goodpass)){
				response.sendRedirect("modify.jsp?num="+num);
			}else{
			response.sendRedirect("modify_pass.jsp?num="+num);
			}
		
			rs.close();
			pstmt.close();
			conn.close();
%>
